package objects
{
	import starling.display.Sprite;
	import starling.text.TextField;
	
	public class Score extends Sprite
	{
		private var _score:TextField;
		
		public function Score()
		{
			super();
			
			_score = new TextField(300, 100, "0", "Komika Display Kaps Wide", 32, 0xffffff);
			this.addChild(_score);
		}
		
		public function addScore(amount:Number):void
		{
			_score.text = (parseInt(_score.text) + amount).toString();
		}
		
		public function destroy():void
		{
			this.removeChild(_score);
			_score.dispose();
			this.removeFromParent(true);
		}
	}
}



































